﻿using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using DBSourceToolsLib;
using DBConnectionLib;

namespace TestDBSourceToolsLibNUnit
{
    [TestFixture]
    [Ignore]
    public class TestSourceDatabase
    {
        [Test]
        public void TestLoadProjectFile()
        {
            string strFileName = BaseDirectoryHelper.TestFiles_control_SourceDatabase + "\\TestSourceDatabase.xml";
            DBSourceToolsLib.DatabaseProject oDBProject = new DatabaseProject(strFileName);
            
            oDBProject.LoadFromDisk(false);
            Assert.Greater(oDBProject.SourceDatabases.Count, 0);
            Assert.AreEqual((string)"DBSourceToolsTestDB", oDBProject.SourceDatabases[0].DatabaseName);
            Assert.AreEqual((string)"DBSourceToolsTestDB_source", oDBProject.SourceDatabases[0].NickName);
            DBSourceToolsLib.SourceDatabase oSourceDatabase = oDBProject.SourceDatabases[0];
            Assert.Greater(oSourceDatabase.TargetDatabases.Count, 0);
        }

        [Test]
        public void TestScriptOptions()
        {
            string strFileName = BaseDirectoryHelper.TestFiles_control_SourceDatabase + "\\TestSourceDatabase.xml";
            DBSourceToolsLib.DatabaseProject oDBProject = new DatabaseProject(strFileName);
            oDBProject.LoadFromDisk(false);

            SourceDatabase oSource = oDBProject.SourceDatabases[0];
            Assert.IsNotNull(oSource.ScriptOptions);

        }

        [Test]
        public void TestWriteCreateDBScript()
        {
            Assert.Fail();
        }
    }
}
